Bug 1065877: prevent OOMs when editing, picking and sharing large images

I left the || null in because I suppose that in theory config_max_image_pixel_size could be 0 and I thought it would be safer...