automatically resize image upload when greater than the allowed max file size allowed