Resize image according to a Format