better image dimension storage method