Unnecessary code deleted. Updated on moodle standard.
Updated on moodle standard.
Deleted 'i' in preg_match with thumb and resized, because risk of error.