Code for RAM-block allocation & image modes added