code fixes for image limit