Adding support to select media size

Move this inside the if