replaced getImageType callback with return
fixed imageType handling
broken data into 3 tables