if (settings.maxh && photo.height > settings.maxh) {
                            // Reduce to the max width || max height
                            percent = (photo.height - settings.maxh) / photo.height;
                            if (photo.width - (photo.width * percent) > settings.maxw) {
                                // Still too wide, use maxw