Added maximum image dimension configuration

Simple check and enforcing of maximum image dimensions.