fixed crash and adjusted image max size