Fixed image resizing #25

Images are now resized to max 1000x1000 pixels.
Images are automatically converted to JPEG.