refactored parts of resize and bugfixed image options