Add support for max filesize of image and automatic compression to match this limit