Fixed issue with target density of loaded image
Added commentaries, one util method.