Added code to make sure image size is sufficient

Image size must be 256 X 256 or greater. Added a check for image
dimensions