writing a image recognition program with my own inputs

I'm trying to create an image recognition program with the dataset as my own images. I only have 506 images (this program is basically a proof of concept). I'm using tensorflow and I'm stuck when it comes to feeding my images and labels.

Tensorflow has this function

batch_xs, batch_ys = mnist.train.next_batch(100)

but I can't use that for my own inputs. I've tried train_test_split, but when running, I get a value error stating

"Cannot feed value of shape (379, 50, 50, 1) for Tensor 'Placeholder:0', which has shape '(?, 2500)'".

I'm not sure where the 379 is coming from. Any suggestions? Here's my code:

x = tf.placeholder(tf.float32, [None, 2500])

W = tf.Variable(tf.zeros([2500, 3]))

b = tf.Variable(tf.zeros([3]))

y = tf.nn.softmax(tf.matmul(x, W) + b)

y_ = tf.placeholder(tf.float32, [None, 3])

cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_ * tf.log(y), reduction_indices=[1]))

train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)

sess = tf.InteractiveSession()

tf.global_variables_initializer().run()

batch_xs, test_x, batch_ys, test__y = train_test_split(img, index, test_size = .25, random_state = 0)
sess.run(train_step, feed_dict= {x: batch_xs, y_: batch_ys})

correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))

#figure out how to get xs and ys into this statement
print(sess.run(accuracy, feed_dict= {x: batch_xs, y_: batch_ys}))