Compress and resize image